package com.boang.time;

import javax.swing.text.DateFormatter;
import java.time.DateTimeException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

/*
    @author:sa
    @date:2024/11/22 11:02
*/
public class LocalDateTimeDemo {
    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH:mm:ss");
        System.out.println(now.format(pattern));
        LocalDateTime localDateTime = LocalDateTime.of(2025, 1,1, 11, 50, 00);
        System.out.println(localDateTime);
    }
}